In network technologies, in order to improve efficiency of a server, server virtualization becomes a trend. In a network in which a virtualization technology is used, data or packets may be transmitted by using the Virtual eXtensible Local Area Network (Virtual eXtensible Local Area Network in English, VXLAN for short) protocol or the Network Virtualization using Generic Routing Encapsulation (Network Virtualization using Generic Routing Encapsulation in English, NVGRE for short) protocol; these two protocols can provide better support for virtual machine (Virtual Machine in English, VM for short) migration and mass tenants. Generally, a specific packet header, for example, a User Datagram Protocol (User Datagram Protocol, UDP for short) or Internet Protocol (Internet Protocol, IP for short) header, is added to an original Ethernet packet, so that a VM may be migrated as required in a virtual network. In addition, a VXLAN network identifier (VXLAN Network Identifier in English, VNI for short) in a VXLAN header or a virtual subnet identifier (Virtual Subnet Identifier, VSID for short) in an NVGRE header is used to identify a tenant or a subnet of a tenant, thereby implementing supporting of mass tenants. Technologies, in which a virtual network (Layer 2 network) in which addressing is performed by using the media access control (Media Access Control in English, MAC for short) may be overlayed over networks (Layer 3 network) including the NVGRE and the VXLAN, in which addressing is performed by using the IP are collectively referred to as network virtualization over L3 (Network Virtualization over L3 in English, NVO3 for short) technologies. A device that performs Ethernet or NVO3 encapsulation and decapsulation on a packet is referred to as a network virtualization edge (Network Virtualization Edge in English, NVE for short).
In the NVO3 technology, a packet is transmitted in a Layer 3 network, which, however, does not support forwarding of unknown unicast or broadcast packets. Therefore, the NVE can send these types of packets only by mapping them to a multicast group or by converting them into unicast packets. In addition, when performing NVO3 encapsulation on an Ethernet packet, the NVE needs to learn a connection relationship between a destination VM or destination host and the NVE. That is, the NVE needs to learn binding relationships between all related VMs or hosts (at least VMs or hosts within a virtual subnet corresponding to a VNI that exists on the NVE) and NVEs of the related VMs or hosts.
In the prior art, an NVE performs head-end replication on a broadcast, unknown unicast and multicast (Broadcast, Unknown unicast and Multicast in English, BUM for short) packet. That is, after receiving a BUM packet and performing multicast tunnel encapsulation on the BUM packet, an NVE of a source VM or host sends the BUM packet directly to a network device; the network device sends the BUM packet to at least one another network device corresponding to a multicast group according to a multicast distribution tree; then, the network device that receives the BUM packet sends the BUM packet to an NVE at a receive end; and the NVE at the receive end performs multicast tunnel decapsulation on the BUM packet.
However, in the foregoing solution, the network device needs to support a multicast routing protocol to construct the multicast distribution tree. The network device generally does not necessarily support the multicast routing protocol; in addition, multicast is not deployed in many existing networks. Therefore, the network device and the at least one another network device need to be modified to support multicast transmission. This causes high difficulty in performing the foregoing solution and a high implementation cost.